#!/bin/sh
tar -cf "${IPKG_INSTROOT}/rom/local.tar" --owner=root --group=root "${IPKG_INSTROOT}/etc"
mkdir -p "${IPKG_INSTROOT}/tmp/local/etc"
chmod 0755 "${IPKG_INSTROOT}/tmp/local"
chmod 0755 "${IPKG_INSTROOT}/tmp/local/etc"
mv "${IPKG_INSTROOT}/etc/preinit" "${IPKG_INSTROOT}/tmp/local/etc/preinit"
mv "${IPKG_INSTROOT}/etc/functions.sh" "${IPKG_INSTROOT}/tmp/local/etc/functions.sh"
rm -rf "${IPKG_INSTROOT}/etc"
ln -s "/tmp/local/etc" "${IPKG_INSTROOT}/etc"
ln -s "/tmp/local" "${IPKG_INSTROOT}/usr/local"
